\(\int \coth ^3(c+d x) (a+b \tanh ^2(c+d x)) \, dx\) [141]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 31 \[ \int \coth ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=-\frac {a \coth ^2(c+d x)}{2 d}+\frac {(a+b) \log (\sinh (c+d x))}{d} \]

[Out]

-1/2*a*coth(d*x+c)^2/d+(a+b)*ln(sinh(d*x+c))/d

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3710, 12, 3556} \[ \int \coth ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {(a+b) \log (\sinh (c+d x))}{d}-\frac {a \coth ^2(c+d x)}{2 d} \]

[In]

Int[Coth[c + d*x]^3*(a + b*Tanh[c + d*x]^2),x]

[Out]

-1/2*(a*Coth[c + d*x]^2)/d + ((a + b)*Log[Sinh[c + d*x]])/d

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3710

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[
(A*b^2 + a^2*C)*((a + b*Tan[e + f*x])^(m + 1)/(b*f*(m + 1)*(a^2 + b^2))), x] + Dist[1/(a^2 + b^2), Int[(a + b*
Tan[e + f*x])^(m + 1)*Simp[a*(A - C) - (A*b - b*C)*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, C}, x] &&
 NeQ[A*b^2 + a^2*C, 0] && LtQ[m, -1] && NeQ[a^2 + b^2, 0]

Rubi steps \begin{align*} \text {integral}& = -\frac {a \coth ^2(c+d x)}{2 d}+\int (a+b) \coth (c+d x) \, dx \\ & = -\frac {a \coth ^2(c+d x)}{2 d}+(a+b) \int \coth (c+d x) \, dx \\ & = -\frac {a \coth ^2(c+d x)}{2 d}+\frac {(a+b) \log (\sinh (c+d x))}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.13 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.26 \[ \int \coth ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {-a \coth ^2(c+d x)+2 (a+b) (\log (\cosh (c+d x))+\log (\tanh (c+d x)))}{2 d} \]

[In]

Integrate[Coth[c + d*x]^3*(a + b*Tanh[c + d*x]^2),x]

[Out]

(-(a*Coth[c + d*x]^2) + 2*(a + b)*(Log[Cosh[c + d*x]] + Log[Tanh[c + d*x]]))/(2*d)

Maple [A] (verified)

Time = 0.24 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.13

method result size
derivativedivides \(\frac {a \left (\ln \left (\sinh \left (d x +c \right )\right )-\frac {\coth \left (d x +c \right )^{2}}{2}\right )+b \ln \left (\sinh \left (d x +c \right )\right )}{d}\) \(35\)
default \(\frac {a \left (\ln \left (\sinh \left (d x +c \right )\right )-\frac {\coth \left (d x +c \right )^{2}}{2}\right )+b \ln \left (\sinh \left (d x +c \right )\right )}{d}\) \(35\)
parallelrisch \(\frac {\left (-2 a -2 b \right ) \ln \left (1-\tanh \left (d x +c \right )\right )+\left (2 a +2 b \right ) \ln \left (\tanh \left (d x +c \right )\right )-\coth \left (d x +c \right )^{2} a -2 \left (a +b \right ) x d}{2 d}\) \(59\)
risch \(-a x -b x -\frac {2 a c}{d}-\frac {2 b c}{d}-\frac {2 a \,{\mathrm e}^{2 d x +2 c}}{d \left ({\mathrm e}^{2 d x +2 c}-1\right )^{2}}+\frac {a \ln \left ({\mathrm e}^{2 d x +2 c}-1\right )}{d}+\frac {\ln \left ({\mathrm e}^{2 d x +2 c}-1\right ) b}{d}\) \(86\)

[In]

int(coth(d*x+c)^3*(a+b*tanh(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

1/d*(a*(ln(sinh(d*x+c))-1/2*coth(d*x+c)^2)+b*ln(sinh(d*x+c)))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 407 vs. \(2 (29) = 58\).

Time = 0.27 (sec) , antiderivative size = 407, normalized size of antiderivative = 13.13 \[ \int \coth ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=-\frac {{\left (a + b\right )} d x \cosh \left (d x + c\right )^{4} + 4 \, {\left (a + b\right )} d x \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + {\left (a + b\right )} d x \sinh \left (d x + c\right )^{4} + {\left (a + b\right )} d x - 2 \, {\left ({\left (a + b\right )} d x - a\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, {\left (a + b\right )} d x \cosh \left (d x + c\right )^{2} - {\left (a + b\right )} d x + a\right )} \sinh \left (d x + c\right )^{2} - {\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{4} + 4 \, {\left (a + b\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + {\left (a + b\right )} \sinh \left (d x + c\right )^{4} - 2 \, {\left (a + b\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, {\left (a + b\right )} \cosh \left (d x + c\right )^{2} - a - b\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{3} - {\left (a + b\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + a + b\right )} \log \left (\frac {2 \, \sinh \left (d x + c\right )}{\cosh \left (d x + c\right ) - \sinh \left (d x + c\right )}\right ) + 4 \, {\left ({\left (a + b\right )} d x \cosh \left (d x + c\right )^{3} - {\left ({\left (a + b\right )} d x - a\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )}{d \cosh \left (d x + c\right )^{4} + 4 \, d \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + d \sinh \left (d x + c\right )^{4} - 2 \, d \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, d \cosh \left (d x + c\right )^{2} - d\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left (d \cosh \left (d x + c\right )^{3} - d \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + d} \]

[In]

integrate(coth(d*x+c)^3*(a+b*tanh(d*x+c)^2),x, algorithm="fricas")

[Out]

-((a + b)*d*x*cosh(d*x + c)^4 + 4*(a + b)*d*x*cosh(d*x + c)*sinh(d*x + c)^3 + (a + b)*d*x*sinh(d*x + c)^4 + (a
 + b)*d*x - 2*((a + b)*d*x - a)*cosh(d*x + c)^2 + 2*(3*(a + b)*d*x*cosh(d*x + c)^2 - (a + b)*d*x + a)*sinh(d*x
 + c)^2 - ((a + b)*cosh(d*x + c)^4 + 4*(a + b)*cosh(d*x + c)*sinh(d*x + c)^3 + (a + b)*sinh(d*x + c)^4 - 2*(a
+ b)*cosh(d*x + c)^2 + 2*(3*(a + b)*cosh(d*x + c)^2 - a - b)*sinh(d*x + c)^2 + 4*((a + b)*cosh(d*x + c)^3 - (a
 + b)*cosh(d*x + c))*sinh(d*x + c) + a + b)*log(2*sinh(d*x + c)/(cosh(d*x + c) - sinh(d*x + c))) + 4*((a + b)*
d*x*cosh(d*x + c)^3 - ((a + b)*d*x - a)*cosh(d*x + c))*sinh(d*x + c))/(d*cosh(d*x + c)^4 + 4*d*cosh(d*x + c)*s
inh(d*x + c)^3 + d*sinh(d*x + c)^4 - 2*d*cosh(d*x + c)^2 + 2*(3*d*cosh(d*x + c)^2 - d)*sinh(d*x + c)^2 + 4*(d*
cosh(d*x + c)^3 - d*cosh(d*x + c))*sinh(d*x + c) + d)

Sympy [F]

\[ \int \coth ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\int \left (a + b \tanh ^{2}{\left (c + d x \right )}\right ) \coth ^{3}{\left (c + d x \right )}\, dx \]

[In]

integrate(coth(d*x+c)**3*(a+b*tanh(d*x+c)**2),x)

[Out]

Integral((a + b*tanh(c + d*x)**2)*coth(c + d*x)**3, x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 106 vs. \(2 (29) = 58\).

Time = 0.20 (sec) , antiderivative size = 106, normalized size of antiderivative = 3.42 \[ \int \coth ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=a {\left (x + \frac {c}{d} + \frac {\log \left (e^{\left (-d x - c\right )} + 1\right )}{d} + \frac {\log \left (e^{\left (-d x - c\right )} - 1\right )}{d} + \frac {2 \, e^{\left (-2 \, d x - 2 \, c\right )}}{d {\left (2 \, e^{\left (-2 \, d x - 2 \, c\right )} - e^{\left (-4 \, d x - 4 \, c\right )} - 1\right )}}\right )} + \frac {b \log \left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )}{d} \]

[In]

integrate(coth(d*x+c)^3*(a+b*tanh(d*x+c)^2),x, algorithm="maxima")

[Out]

a*(x + c/d + log(e^(-d*x - c) + 1)/d + log(e^(-d*x - c) - 1)/d + 2*e^(-2*d*x - 2*c)/(d*(2*e^(-2*d*x - 2*c) - e
^(-4*d*x - 4*c) - 1))) + b*log(e^(d*x + c) - e^(-d*x - c))/d

Giac [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.87 \[ \int \coth ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=-\frac {{\left (d x + c\right )} {\left (a + b\right )} - {\left (a + b\right )} \log \left ({\left | e^{\left (2 \, d x + 2 \, c\right )} - 1 \right |}\right ) + \frac {2 \, a e^{\left (2 \, d x + 2 \, c\right )}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} - 1\right )}^{2}}}{d} \]

[In]

integrate(coth(d*x+c)^3*(a+b*tanh(d*x+c)^2),x, algorithm="giac")

[Out]

-((d*x + c)*(a + b) - (a + b)*log(abs(e^(2*d*x + 2*c) - 1)) + 2*a*e^(2*d*x + 2*c)/(e^(2*d*x + 2*c) - 1)^2)/d

Mupad [B] (verification not implemented)

Time = 1.82 (sec) , antiderivative size = 76, normalized size of antiderivative = 2.45 \[ \int \coth ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {\ln \left ({\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}-1\right )\,\left (a+b\right )}{d}-\frac {2\,a}{d\,\left ({\mathrm {e}}^{2\,c+2\,d\,x}-1\right )}-\frac {2\,a}{d\,\left ({\mathrm {e}}^{4\,c+4\,d\,x}-2\,{\mathrm {e}}^{2\,c+2\,d\,x}+1\right )}-x\,\left (a+b\right ) \]

[In]

int(coth(c + d*x)^3*(a + b*tanh(c + d*x)^2),x)

[Out]

(log(exp(2*c)*exp(2*d*x) - 1)*(a + b))/d - (2*a)/(d*(exp(2*c + 2*d*x) - 1)) - (2*a)/(d*(exp(4*c + 4*d*x) - 2*e
xp(2*c + 2*d*x) + 1)) - x*(a + b)